import request from '@/utils/bsinRequest';
import { AirdropParamsType, getThemeNftListParamsType } from './data';

// 查询空投规则列表
export const getDeliverRulerList = (params: any) => {
  return request('/getPageList', {
    serviceName: 'AdminAirdropRuleService',
    methodName: 'getPageList',
    bizParams: {
      ...params,
    },
  });
};

// 新增空投规则
export const addDeliverRulers = (params: any) => {
  return request('/add', {
    serviceName: 'AdminAirdropRuleService',
    methodName: 'add',
    bizParams: {
      ...params,
    },
  });
};

// 删除空投规则
export const deleteDeliverRulers = (params: { serialNo: string }) => {
  return request('/delete', {
    serviceName: 'AdminAirdropRuleService',
    methodName: 'delete',
    bizParams: {
      ...params,
    },
  });
};

// 空投规则详情
export const DeliverRulerInfo = (params: { serialNo: string }) => {
  return request('/getAirdropRule', {
    serviceName: 'AdminAirdropRuleService',
    methodName: 'getAirdropRule',
    bizParams: {
      ...params,
    },
  });
};

// 执行空投
export const airdrop = (params: AirdropParamsType) => {
  return request('/airdrop', {
    serviceName: 'AdminNftThemeService',
    methodName: 'airdrop',
    bizParams: {
      ...params,
    },
  });
};

// 获取nft列表
export const getThemeNftList = (params: {
  current: number;
  pageSize: number;
}) => {
  return request('/getPageList', {
    serviceName: 'AdminNftThemeService',
    methodName: 'getPageList',
    bizParams: {
      ...params,
    },
  });
};

// 查询主题nft碎片详情
export const getFragmentsByThemeNo = (params: getThemeNftListParamsType) => {
  return request('/getThemeByThemeNo', {
    serviceName: 'AdminNftThemeService',
    methodName: 'getFragmentsByThemeNo',
    bizParams: {
      ...params,
    },
  });
};
